home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
impdes
/
dessin.bas
next >
Wrap
BASIC Source File
|
1995-09-07
|
22KB
|
376 lines
' '
' '
'DΘfinition des types '
' '
' '
Option Explicit
DefInt A-Z
Type BITMAPINFOHEADER_Type
biSize As Long
biWidth As Long
biHeight As Long
biPlanes As Integer
biBitCount As Integer
biCompression As Long
biSizeImage As Long
biXPelsPerMeter As Long
biYPelsPerMeter As Long
biClrUsed As Long
biClrImportant As Long
End Type
Type BITMAPINFO_Type
BitmapInfoHeader As BITMAPINFOHEADER_Type
bmiColors As String * 1024
End Type
Type RectType
Left As Integer
Top As Integer
Right As Integer
Bottom As Integer
End Type
Type PointType
X As Integer
Y As Integer
End Type
' '
' '
'API '
' '
' '
Declare Function CreateCompatibleDC Lib "gdi" (ByVal hDC)
Declare Function GetWindowDC Lib "user" (ByVal hWnd)
Declare Function GetDC Lib "user" (ByVal hWnd)
Declare Function ReleaseDC Lib "user" (ByVal hWnd, ByVal hDC)
Declare Function DeleteDC Lib "gdi" (ByVal hDC)
' Graphics related API
Declare Function BitBlt Lib "gdi" (ByVal hDC, ByVal X, ByVal Y, ByVal w, ByVal h, ByVal hDC, ByVal X, ByVal Y, ByVal o As Long)
Declare Function GetDIBits Lib "gdi" (ByVal hDC, ByVal hBitmap, ByVal nStartScan, ByVal nNumScans, ByVal LpBits As Long, BitmapInfo As BITMAPINFO_Type, ByVal wUsage)
Declare Function StretchDIBits Lib "gdi" (ByVal hDC, ByVal DestX, ByVal DestY, ByVal wDestWidth, ByVal wDestHeight, ByVal SrcX, ByVal SrcY, ByVal wSrcWidth, ByVal wSrcHeight, ByVal LpBits&, BitsInfo As BITMAPINFO_Type, ByVal wUsage, ByVal dwRop&)
' General attribute related API
Declare Function GetDeviceCaps Lib "gdi" (ByVal hDC, ByVal nIndex)
Declare Function GetWindowRect Lib "user" (ByVal hWnd, lpRect As RectType)
Declare Function GetClientRect Lib "user" (ByVal hWnd, lpRect As RectType)
' Memory allocation related API
Declare Function GlobalAlloc Lib "kernel" (ByVal wFlags, ByVal lMem&)
Declare Function GlobalLock Lib "kernel" (ByVal HMem) As Long
Declare Function GlobalUnlock Lib "kernel" (ByVal HMem)
Declare Function GlobalFree Lib "kernel" (ByVal HMem)
' Graphics object related API
Declare Function CreateCompatibleBitmap Lib "gdi" (ByVal hDC, ByVal nWidth, ByVal nHeight)
Declare Function DeleteObject Lib "gdi" (ByVal hObject)
Declare Function SelectObject Lib "gdi" (ByVal hDC, ByVal hObject)
Declare Function ClientToScreen Lib "user" (ByVal hWnd, P As PointType)
Declare Function LPToDP Lib "gdi" (ByVal hDC, P As PointType, ByVal nCount)
' '
' '
'DΘfinition des Global Constantes '
' '
' '
Global Const HORZRES = 8
Global Const VERTRES = 10
Global Const SRCCOPY = &HCC0020
Global Const NEWFRAME = 1
Global Const BITSPIXEL = 12
Global Const PLANES = 14
Global Const BI_RGB = 0
Global Const BI_RLE8 = 1
Global Const BI_RLE4 = 2
Global Const DIB_PAL_COLORS = 1
Global Const DIB_RGB_COLORS = 0
Global Const GMEM_MOVEABLE = 2
Sub ImprimeGraphique (F As Form)
Dim R As Integer
' '
' '
'Cette procΘdure permet l'impression d'une fenΩtre '
' '
' '
Printer.ScaleMode = 3
Screen.MousePointer = 11
Printer.Print ""
'Appel de la fonction